package com.dzsw.javabase.str;

import cn.hutool.core.util.StrUtil;
import com.google.common.base.CaseFormat;
import org.apache.commons.lang3.StringUtils;

public class CamelCase2SnakeCase {

    public static void main(String[] args) {
        String ss = "DSComeOn";
        gauva(ss);
        hutool(ss);
        commonLang3(ss);
    }

    public static void gauva(String str) {
        String s = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, str);
        System.out.println("CamelCase2SnakeCase.guava >> " + s);
    }

    public static void hutool(String str) {
        String s = StrUtil.toUnderlineCase(str);
        System.out.println("CamelCase2SnakeCase.hutool >> " + s.toLowerCase());
    }

    public static void commonLang3(String str) {
        String s = StringUtils.uncapitalize(str);
        System.out.println("uncapitalize >> " + s);
    }
}
